# by default load index.php from a path
DirectoryIndex router.php
# make sure trailing slash is present for directories
DirectorySlash On

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . router.php [L]

#Alternate default index page
DirectoryIndex index.php

AddType application/x-httpd-php .js

# Redirect www site to without www site
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]